package com.hly.musicbackground.model.boots.rest;

import com.hly.musicbackground.model.boots.VO.FictionClassVO;
import com.hly.musicbackground.model.boots.service.FictionService;
import com.hly.musicbackground.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 小说分类
 * */
@RestController
@RequestMapping("/api/fictionClass")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(tags = "小说分类")
public class FictionClassController {

    private final FictionService fictionService;

    /**
     * 获取小说分类
     * */
    @GetMapping("/list")
    @ApiOperation(value = "获取小说分类")
    public Result<List<FictionClassVO>> list(){
        return Result.ok(fictionService.getFictionClassList());
    }

}
